//
//  MLWDetailViewController.m
//  KITCHEN_STORIES
//
//  Created by dllo on 16/6/8.
//  Copyright © 2016年 MLW. All rights reserved.
//

#import "MLWDetailViewController.h"
#import <WebKit/WebKit.h>
@interface MLWDetailViewController ()

@end

@implementation MLWDetailViewController

- (void)dealloc
{
    [_webView release];
    
    [super dealloc];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    
    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)];

    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.detailStr]]];
    
     self.webView.scalesPageToFit = YES;
    
    [self.view addSubview:_webView];
    [_webView release];
}


//注入JS 去除广告
//-(void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
//{
//    
//    // 判断为网上厨房的链接
//    if ([[[self.detailStr componentsSeparatedByString:@"?"] objectAtIndex:0] isEqualToString:[[DETAIL_URL(@"a") componentsSeparatedByString:@"?"] objectAtIndex:0]] ) {
//        
//        [webView evaluateJavaScript:@"document.getElementsByTagName('div')[0].style.display = 'none'" completionHandler:nil];
//        
//        [webView evaluateJavaScript:@"document.getElementById('footer').style.display = 'none'" completionHandler:nil];
//        
//    }
//
//    
//}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
